home *** CD-ROM | disk | FTP | other *** search
/ PC User 2002 April / Disc 2 / PCUSER0402D2.iso / software / utils / files / wincron.exe / data1.cab / Sample_Scripts / kill_test.tg < prev    next >
Encoding:
Text File  |  2001-10-20  |  1.5 KB  |  54 lines

  1. ## kill_test.tg
  2. # This script continually loads and deletes jobs.
  3. # Part of the normal WinCron regression tests, this script is also useful for those wishing
  4. #    to learn about dynamically loading and destroying jobs.
  5. # This script assumes:
  6. # 1. TG.SCRIPT_DIR has been set. 
  7. #    This variable is usually set in the Config.tg, auto running script.
  8.  
  9. # load and kill jobs, forever
  10. {
  11.     -start 
  12.     -name kill_test
  13.     -action -print Loading scripts from: %TG.SCRIPT_DIR%
  14.  
  15.     # load some simple scripts that just print their names repeatedly
  16.     # the scripts are: kill_test_0{1,2,3,4,5,6}.tg
  17.     -action -load "%TG.SCRIPT_DIR%kill_test_0*.tg"
  18.  
  19.     # and do this again in one minute
  20.     -action -inc 0 0 1 0
  21. }
  22.  
  23. # load the death-star!, (every 1 minute, 30 seconds)
  24. # This script will search out and destroy the other scripts:
  25. # kill_test_0{1,2,3,4,5,6}.tg
  26. {
  27.     -name START DEATH-STAR
  28.  
  29.     # run 1.5 minutes from now, that should give the above script enough time
  30.     # to load another batch of jobs.
  31.     -start -delay 0 0 1 30
  32.     -action -print looking to start the DEATH-STAR!
  33.     # sleep so we can read the output
  34.     -action -sleep 5000
  35.     -action -load "%TG.SCRIPT_DIR%kill_test_main.tg"
  36.     -action -inc 0 0 1 30
  37.  
  38. }
  39.  
  40. # kill the death-star!, (every 1 minute, 40 seconds)
  41. {
  42.     -name KILL DEATH-STAR
  43.  
  44.     # allow the DEATH-STAR to kill jobs for 10 seconds before we put an end to this monster.
  45.     -start -delay 0 0 1 40
  46.     -action -print looking to kill the DEATH-STAR!
  47.     # sleep so we can read the output
  48.     -action -sleep 5000
  49.     -action -kill THE DEATH-STAR
  50.     -action -inc 0 0 1 40
  51. }
  52.  
  53.  
  54.